package com.engineering.elink.videodao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.engineering.elink.co.BaseCo;
import com.engineering.elink.co.CourseCo;
import com.engineering.elink.co.HierCo;
import com.engineering.elink.domain.Course;
import com.engineering.elink.vo.CourseVo;
import com.engineering.elink.vo.EnginCourseVo;
import com.engineering.elink.vo.EvaluateMeCourseVo;
import com.engineering.elink.vo.TeacherVo;
import com.engineering.elink.vo.VideoCollectionVo;

public interface CourseMapper {
    int deleteByPrimaryKey(Integer courseId);

    int insert(Course record);

    int insertSelective(Course record);

    Course selectByPrimaryKey(Integer courseId);

    int updateByPrimaryKeySelective(Course record);

    int updateByPrimaryKeyWithBLOBs(Course record);

    int updateByPrimaryKey(Course record);

 	List<Map<String, Object>> select(Map<String,Object> map);

 	Integer selectPageCount(Map<String,Object> map);

	List<CourseVo> selectList(@Param("co") CourseCo co,@Param("userId")String userId);

	int selectCount(@Param("co") CourseCo co,@Param("userId")String userId);
	
	List<VideoCollectionVo> getMyCollect(@Param("co") BaseCo co,@Param("userId") String userId);
	
	int selectCountMyCollect(@Param("userId") String userId);

	List<CourseVo> getHotCourse(@Param("co") BaseCo co);
	
	int selectCountHotCourse();

	List<CourseVo> getBrowseCourse(@Param("co") BaseCo co);
	
	int selectCountBrowseCourse();
	
	TeacherVo selectInfo(@Param("courseId") Integer courseId,@Param("userId") String userId);

	int selectTeacherCount(@Param("userId") String userId);
	
	List<CourseVo> getTeacherCourse(@Param("co") BaseCo co,@Param("userId") String userId);

	List<CourseVo> getSameCourse(@Param("co") BaseCo co,@Param("courseId") Integer courseId);
	
	Integer countSameCourse(@Param("courseId") Integer courseId);

	List<EvaluateMeCourseVo> getEvaluateForMe(@Param("co")BaseCo co,@Param("userId")String userId);

	List<EvaluateMeCourseVo> getMyEvaluate(@Param("co")BaseCo co,@Param("userId")String userId);
	
	List<TeacherVo> getMyCourse(@Param("co")BaseCo co,@Param("userId") String userId);

	int selectCountMyCourse(String userId);
	
	List<Course> selectCourseByVideoId(Integer videoId);

	List<CourseVo> getHierCourse(@Param("co")HierCo co);
	
	int selectHierCourseCount(@Param("co") HierCo co);
	
	List<EnginCourseVo> selectEnginCourse(Map<String,Object> map);
	
	int updateCourseByType(Integer type);
	
	@Select(" select count(1) from course where auth_status=1 and (type=0 or type is null) ")
	int selectCountNotType();
	
}